﻿using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using Microsoft.SqlServer.Types;
using MyFloridaHouse.DataAccess.Extensions;

namespace MyFloridaHouse.DataAccess
{
    public partial class DAL_CensusData
	{
		public List<SqlGeometry> GetDistrictGeometryShape(string iUogIDList)
		{
            List<SqlGeometry> itemList = new List<SqlGeometry>();
            string storedProcedureName = "usp_tl10GetGeometriesFromUogIDList10";
            using (SqlConnection db = Connect())
            {
                SqlCommand StoredProcedureCommand = new SqlCommand(storedProcedureName, db);
                StoredProcedureCommand.CommandType = CommandType.StoredProcedure;
                SqlParameter dataPartIDParm = StoredProcedureCommand.Parameters.AddWithValue("uogIDList", iUogIDList);
                dataPartIDParm.Direction = ParameterDirection.Input;
                db.Open();
                using (SqlDataReader rdr = StoredProcedureCommand.ExecuteReader())
                {
                    while (rdr.Read())
                    {
                        itemList.Add(DistrictShapeGeometry_DataContract.DataContract(rdr));
                    }
                }
            }

            return itemList;
		}
	}

}
